//
//  HDApplyCashViewController.swift
//  HuaDaoPeifu
//
//  Created by ZERO on 2018/6/5.
//  Copyright © 2018年 paiyipai. All rights reserved.
//

import UIKit



class HDApplyCashViewController: UIViewController, SinglePickerViewDelegate {

    
    
    @IBOutlet weak var typeView: UIView!
    
    @IBOutlet weak var cardView: UIView!
   
    @IBOutlet weak var nameView: UIView!
    
    @IBOutlet weak var moneyView: UIView!
    
    @IBOutlet weak var typeLabel: UILabel!
    
    @IBOutlet weak var cardnumberTF: UITextField!
    
    @IBOutlet weak var nameTF: UITextField!
    
    @IBOutlet weak var tipsLabel: UILabel!
    
    @IBOutlet weak var moneyTF: UITextField!
    // 余额
    @IBOutlet weak var balanceLabel: UILabel!
    
   var picker: SinglePickerView!
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        title = "申请提现"

        setUI()
    }

    
    func setUI() {
        typeView.layer.borderWidth = 1
        typeView.layer.cornerRadius = 3
        typeView.layer.borderColor = UIColor(hex: 0xdbdbdb).cgColor
        
        cardView.layer.borderWidth = 1
        cardView.layer.cornerRadius = 3
        cardView.layer.borderColor = UIColor(hex: 0xdbdbdb).cgColor
        
        nameView.layer.borderWidth = 1
        nameView.layer.cornerRadius = 3
        nameView.layer.borderColor = UIColor(hex: 0xdbdbdb).cgColor
        
        moneyView.layer.borderWidth = 1
        moneyView.layer.cornerRadius = 3
        moneyView.layer.borderColor = UIColor(hex: 0xdbdbdb).cgColor
        
        let text = "预计24小时到账，请注意查收。（时间提示信息可根据实际财务情况而定）"
        let attributeText = NSMutableAttributedString.init(string: text)
        let count = text.characters.count
        attributeText.addAttributes([NSForegroundColorAttributeName: UIColor.red], range: NSMakeRange(15, 19))

        let paragraphStyle = NSMutableParagraphStyle()
        paragraphStyle.lineSpacing = 3     //设置行间距
        attributeText.addAttributes([NSParagraphStyleAttributeName: paragraphStyle], range: NSMakeRange(0, count))
       tipsLabel.attributedText = attributeText
        
        picker                 = SinglePickerView()
        //        picker?.Type                = SingleListTypeDiscuz
        picker?.delegate            = self
        picker?.arr = ["银行卡", "其他"]
    }
    
    // 选择提现方式
    @IBAction func typeSelectAction(_ sender: UIButton) {
        picker?.showInView()
    }
    func complete(_ pickerView: UIView!, tempStr str: String!, idStr idstr: String!) {
        typeLabel.text = str
    }
    // 全部提现
    @IBAction func AllOutAction(_ sender: UIButton) {
        
    }
    
    // 提现
    @IBAction func cashOutAction(_ sender: UIButton) {
        
    }
    
    // 撤销键盘
    override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
        cardnumberTF.resignFirstResponder()
        nameTF.resignFirstResponder()
        moneyTF.resignFirstResponder()
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
